package com.gaia.member.gaiatt.ui;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;

import com.gaia.member.androidlib.utils.LogUtil;

/**
 * Created by zhangHaiTao on 2016/5/3.
 */
public class MyView extends View{
    public MyView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        LogUtil.w(MeasureSpec.getMode(widthMeasureSpec)==MeasureSpec.EXACTLY?"EXACTLY":"AT_MOST");
        LogUtil.w(MeasureSpec.getSize(widthMeasureSpec)+"");
        LogUtil.w(MeasureSpec.getMode(heightMeasureSpec)==MeasureSpec.EXACTLY?"EXACTLY":"AT_MOST" + "");
        LogUtil.w(MeasureSpec.getSize(heightMeasureSpec) + "");
        LogUtil.w(getSuggestedMinimumWidth() + "");
        LogUtil.w(getSuggestedMinimumHeight() + "");
        LogUtil.w(getDefaultSize(getSuggestedMinimumWidth(), widthMeasureSpec) + "");
        LogUtil.w(getDefaultSize(getSuggestedMinimumHeight(), heightMeasureSpec) + "");
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);

        setMeasuredDimension(200, 200);
    }
}
